package com.zlsy.springbootdemo.abstractfactory.demo;

import com.zlsy.springbootdemo.abstractfactory.demo.color.ColorFactory;
import com.zlsy.springbootdemo.abstractfactory.demo.shape.ShapeFactory;

/**
 * @author zhouliang
 * @date 2021/1/22 10:18
 */
public class FactoryProducer {
  public static AbstractFactory getFactory(String choice) {
    if (choice.equalsIgnoreCase("SHAPE")) {
      return new ShapeFactory();
    } else if (choice.equalsIgnoreCase("COLOR")) {
      return new ColorFactory();
    }
    return null;
  }
}
